#include <iostream>
using namespace std;

int removeDuplicates(int A[], int n) {
    // Start typing your C/C++ solution below
    // DO NOT write int main() function
    if(n<2){
        return n;
    }

    int readI = 1;
    int writeI = 1;
    for(readI=1; readI < n; ++readI){
        if(A[readI] != A[readI-1]){
            A[writeI] = A[readI];
            ++writeI;
        }
    }

    return writeI;
}

int main(){
    return 0;
}